public class Main {

    static class Solution {
        public boolean isPalindrome(String s) {
            int length = s.length();
            StringBuilder sgood = new StringBuilder();
            for (int i = 0; i < length; i++) {
                char ch = s.charAt(i);
                if (Character.isLetter(ch)) {
                    sgood.append(ch);
                }
            }
            sgood.toString();
            length = sgood.length();
            int head = 0;
            int tail = length - 1;
            while (head < tail) {
                if (sgood.charAt(head) != sgood.charAt(tail)) {
                    return false;
                }
                head++;
                tail--;
            }
            return true;
        }
    }

    public static void main(String[] args) {
        Solution simple = new Solution();
        System.out.println(simple.isPalindrome("A man, a plan, a canal: Panama"));
    }
}